package com.maiji.cloud.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.maiji.cloud.entities.login.ShareWeightHelpUserLogEntity;

/**
 * 
 * Description:
 * 
 * @author zhanglr
 * @date 2019年9月9日
 */
@Mapper
public interface ShareWeightHelpUserLogMapper extends BaseMapper<ShareWeightHelpUserLogEntity> {
	/**
	 * 根据用id判断是否是新人
	 * 
	 * @param userId
	 * @return
	 */
	ShareWeightHelpUserLogEntity selectOneByUserId(@Param("userId") String userId);

	/**
	 * 根据分享记录id和用户id查询
	 * @param reduceWeightFundLogId
	 * @param userId
	 * @return
	 */
	ShareWeightHelpUserLogEntity selectOneByreduceWeightFundLogId(
			@Param("reduceWeightFundLogId") String reduceWeightFundLogId, @Param("userId") String userId);

	/**
	 * 今天是否帮别人助力过
	 * @param zeroTime
	 * @param userId
	 * @return
	 */
	ShareWeightHelpUserLogEntity selectOneByTime(@Param("zeroTime")Date zeroTime, @Param("userId") String userId);
	
	/**
	 * 根据分享id获得用户获取助力集合
	 * @param reduceWeightFundLogId
	 * @return
	 */
	List<ShareWeightHelpUserLogEntity> selectListByReduceWeightFundLogId(@Param("reduceWeightFundLogId")String reduceWeightFundLogId,@Param("start")Integer start,@Param("limit")Integer limit);
	/**
	 * 获得助力总额
	 * @param reduceWeightFundLogId
	 * @return
	 */
	Double getSumFund(@Param("reduceWeightFundLogId")String reduceWeightFundLogId);
	
	
	/**
	 * 获得助力总人数
	 * @param reduceWeightFundLogId
	 * @return
	 */
	Integer getSumCount (@Param("reduceWeightFundLogId")String reduceWeightFundLogId);
	
	

}
